package com.base.component.app.push.jpush;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import com.base.component.app.push.bo.PushBO;
import com.base.component.app.push.bo.PushIdBO;
import com.base.core.head.enums.PushPlatformEnum;

import cn.jiguang.sdk.constants.ApiConstants;

/**
 * 
 * @author start
 */
@Component
public class JpushAll extends JpushBase<PushBO> {

	@Override
	public Boolean support(PushPlatformEnum platform,Class<?> prorotype) {
		return PushPlatformEnum.JPUSH==platform
				&&prorotype.equals(PushBO.class);
	}
	
	@Override
	public void execute(PushBO param) {
		PushIdBO p=new PushIdBO();
		BeanUtils.copyProperties(param, p);
		p.setTokenId(ApiConstants.Audience.ALL);
		push(p);
	}
	
}
